from tortoise import fields
from datetime import datetime
from .base import BaseModel, TimestampMixin


class SysNotice(BaseModel, TimestampMixin):
    """通知公告表"""

    notice_id = fields.IntField(pk=True, description="公告ID")

    notice_title = fields.CharField(max_length=50, description="公告标题")

    notice_type = fields.CharField(max_length=1, description="公告类型（1通知 2公告）")

    notice_content = fields.CharField(max_length=4294967295, null=True, description="公告内容")

    status = fields.CharField(max_length=1, null=True, description="状态（0正常 2删除）")

    create_by = fields.CharField(max_length=64, null=True, description="创建者")

    create_time = fields.DatetimeField(null=True, description="创建时间")

    update_by = fields.CharField(max_length=64, null=True, description="更新者")

    update_time = fields.DatetimeField(null=True, description="更新时间")

    remark = fields.CharField(max_length=255, null=True, description="备注")

    class Meta:
        table = "sys_notice"

    def __str__(self):
        return f"{self.notice_id}"